//Erik Wright
//marionette.h
//11-4-2013

/*
this file describes the structure of the marionette_control class that is being used to 
define how the puppet will learn to walk, run, dance, etc.

The below strucure outlines a series of vertical controlers, horizontal body controllers,
and positional controllers.  The vertical controlers and positional controllers are continuous
 rotation servos; the horizontal controlers are direct angle controlers.  These should ultimately
not matter as the genetic algorithm should allow each controller to evolve its motions independantly
and thus ensure the overall motion of the robot. 
*/



#include "bot_motion.h"


class marionette_control
{
	private:
		int rating;	//current generation rating
		float fuzzy_membership[5];	//current fuzzy membership
		int num_controllers;	//the number of controller channels, or length of controller_array
		motion_event** controller_array;	//expands to any number of controllers 
		

	public:
		~marionette_control();		//class destructor
		marionette_control();		//default constructor
		marionette_control(int, int);	//loaded constructor | use like default
		int find_num_controllers();	//find the number of controllers
		void display_sequence();	//displays entire chromosome
		void give_rating();		//gives a rating to chromo
		int get_rating();		//get the current rating
		void binary_twist(marionette_control *&);	//performs a binary twist
		void binary_twist_rand(marionette_control *&, bool);	//performs a binary twist at a random length
		int fuzzy_twist(marionette_control *&);	//performs a fuzzy twist based on rating
		int fuzzy_decision();		//decide which output membership
		void average_twist(marionette_control *&);	//performs twist as average
		void weighted_average_twist(marionette_control *&);	//performs weighted average twist
};	
